package com.xauto.pioneer.appuser.model;

import org.json.JSONObject;

/**订单列表模型
 * Created by Ellis.Li on 2017/5/12.
 */
public class OrderInfo extends BaseModel<OrderInfo> {

    /** 车辆订单ID*/
    public String car_order_id;
    /** 车辆订单编号*/
    public String car_order_no;
    /** 车辆订单状态ID*/
    public String car_order_status_id;
    /** 车辆订单状态名称*/
    public String car_order_status_name;
    /** 车辆订单状态显示名称*/
    public String car_order_status_display_name;
    /** 总计*/
    public String total_amount;
    /** 格式化(10.00元)*/
    public String total_amount_format;
    /** 附件信息(1-是/0-否)*/
    public String is_extend_info;
    /** 订单时间(unix_time)*/
    public String order_time;
    /** 订单时间(格式化)*/
    public String order_time_format;

    @Override
    public OrderInfo parse(JSONObject jsonObject) {
        if(jsonObject != null) {
            car_order_id = jsonObject.optString("car_order_id");
            car_order_no = jsonObject.optString("car_order_no");
            car_order_status_id = jsonObject.optString("car_order_status_id");
            car_order_status_name = jsonObject.optString("car_order_status_name");
            car_order_status_display_name = jsonObject.optString("car_order_status_display_name");
            total_amount = jsonObject.optString("total_amount");
            total_amount_format = jsonObject.optString("total_amount_format");
            is_extend_info = jsonObject.optString("is_extend_info");
            order_time = jsonObject.optString("order_time");
            order_time_format = jsonObject.optString("order_time_format");
            return this;
        }
        return null;
    }
}
